import { getStore } from "../../storage/storage"
import { axios } from "../../utils/axios"

// 获取用户或企业的全部信息（通过account）
export function getCompanyOrUserAllInfo(parameter){
    return axios({
        url: "/personal/allInfo",
        method: 'get',
        params: parameter,
        headers: {
            token: getStore("token")
        },
    })
}

// 登录用户修改自己的信息
export function updateLoginUserInfo(data){
    return axios({
        url: "/personal/updateLoginUserInfo",
        method: 'post',
        data: data,
        headers: {
            token: getStore("token")
        },
    })
}

// 查询当前登陆的用户的简历信息
export function queryLoginUserResume(param){
    return axios({
        url: "/resume/queryLoginUserResume",
        method: 'get',
        params: param,
        headers: {
            token: getStore("token")
        },
    })
}

// 保存简历
export const saveResume = (params) =>{
    return axios({
        url: "/resume/saveResume",
        method: 'post',
        data: params,
        headers: {
            token: getStore("token")
        },
    })
}

// 判断当前登录的用户是否有简历
export const checkHaveResume = (params) =>{
    return axios({
        url: "/resume/checkHaveResume",
        method: 'get',
        params: params,
        headers: {
            token: getStore("token")
        },
    })
}

// 投递简历
export const deliverResume = (params) =>{
    return axios({
        url: "/resume/deliverResume",
        method: 'post',
        data: params,
        headers: {
            token: getStore("token")
        },
    })
}

// 判断当前职位是否已经投递
export const checkIsDeliver = (params) =>{
    return axios({
        url: "/resume/checkIsDeliver",
        method: 'get',
        params: params,
        headers: {
            token: getStore("token")
        },
    })
}

// 判断当前登陆的用户是否有投递记录
export const checkLoginUserIsHaveDeliverRecord = (params) =>{
    return axios({
        url: "/resume/checkLoginUserIsHaveDeliverRecord",
        method: 'get',
        params: params,
        headers: {
            token: getStore("token")
        },
    })
}

// 查询当前登录用户的投递记录
export const queryLoginUserDeliverRecord = (params) =>{
    return axios({
        url: "/resume/queryLoginUserDeliverRecord",
        method: 'get',
        params: params,
        headers: {
            token: getStore("token")
        },
    })
}

// 通过userJobAid查询用户的简历信息
export const queryClickUserResume = (params) =>{
    return axios({
        url: "/resume/queryClickUserResume",
        method: 'get',
        params: params,
        headers: {
            token: getStore("token")
        },
    })
}